/**
 * @author wangj881
 * @date 2024-10-02 10:53
 */
public class L941 {
    public static void main(String[] args) {

        int[] arr = {9,8,7,6,5,4,3,2,1,0};
        boolean b = new Solution().validMountainArray(arr);
        System.out.println(b);
    }

    static class Solution {
        public boolean validMountainArray(int[] arr) {
            if (null == arr || arr.length < 3) {
                return false;
            }
            int k = 1;
            for (int i = 1; i < arr.length; i++) {
                if (arr[i] <= arr[i - 1]) {
                    k = i;
                    break;
                }
            }
            if (k == 1 || k == arr.length || arr[k] == arr[k - 1]) {
                return false;
            }

            for (int j = k; j < arr.length - 1; j++) {
                if (arr[j] <= arr[j + 1]) {
                    return false;
                }
            }
            return true;
        }
    }
}
